home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-16 | 2.3 KB | 78 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CGraphGADoc.h ©1995-97 Timo Eloranta All rights reserved.
- // ===========================================================================
- // The application class - subclassed from LDocument.
-
- #pragma once
-
- #include <LDocument.h>
- #include <LPeriodical.h>
-
- #include "MyStructs.h"
- #include "CPopulation.h"
-
- typedef vector<SNodePair, allocator<SNodePair> > SNodePairVector;
-
- Boolean GridSizeOK( Int16 inGridSize, Int16 inNodes);
-
- class CGraphPane;
- class CGraphWindow;
- class CMyFileStream;
-
- class CGraphGADoc : public LDocument,
- public LPeriodical {
- private:
- CMyFileStream *mMyFile; // Replaces the LFile...
- // ... and used instead of mFile
-
- CGraphWindow *mWindow; // Pointer to the window...
- CGraphPane *mGraphPane; // Pointer to the graph pane...
-
- SGraphSize mGraphSize; // Holds info on the nbr of
- // nodes and edges in the graph
-
- SNodePairVector mEdgeArray; // An array of the edges
- // ( edge = 2 node nbrs... )
-
- // Boolean mRandomGraph; // Is this a random graph?
-
- CPopulation mPopulation; // A population of graph drawings
- // owned by this document.
-
- EIterState mIterState;
- Int16 mMaxSpendTime; // Max number of ticks that the
- // SpendTime function may spend
- // on one calling...
-
-
- void PrepareToIterate( Boolean inDrawGraphNow );
- void SetIterState( EIterState inIterState);
-
- public:
- CGraphGADoc( LCommander *inSuper, FSSpec *inFileSpec);
- ~CGraphGADoc() {};
-
- virtual Boolean ObeyCommand(CommandT inCommand, void *ioParam);
- virtual void FindCommandStatus(CommandT inCommand,
- Boolean &outEnabled, Boolean &outUsesMark,
- Char16 &outMark, Str255 outName);
-
- void SpendTime( const EventRecord &inMacEvent);
-
- virtual void DoPrint() {};
- virtual StringPtr GetDescriptor(Str255 outDescriptor) const;
-
- void SetPopProbabilities( Int16 inCrossoverProb,
- Int16 inMutationProb ) {
- mPopulation.SetProbabilities(
- inCrossoverProb,
- inMutationProb ); };
-
- void SetPopTermination( STermination &inTermination ) {
- mPopulation.SetTermination( inTermination ); };
-
- protected:
- void NameNewDoc();
- Boolean OpenFile( FSSpec &inFileSpec);
- };
-